package http

import (
	"context"

	"gitee.com/linxing_3/sr-core/server/net/http"
	"gitee.com/mkwchecking/sr-admin/apps/admin/adapter/http/router"
	"gitee.com/mkwchecking/sr-admin/apps/admin/adapter/http/wire"
)

func InitHttp(ctx context.Context) error {
	return router.InitHttpRouter(ctx)
}

func OnStart(ctx context.Context) error {
	apiRepo, err := wire.NewSysApiRepo(ctx)
	if err != nil {
		return err
	}

	return apiRepo.InstallFromGin(http.GetInstanceEngine())
}
